<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #container {
            width: 900px;
            height: 600px;
        }
    </style>
</head>

<body>

    <div id='container'></div>

    <button>北京</button>
    <button>上海</button>

    <script src='https://webapi.amap.com/maps?v=2.0&key=19ee116b8408ee61e3230b9679bf3d5f'></script>
    <script>
        var map = new AMap.Map('container', {
            center: [121.473701, 31.230416],//中心点坐标
        })

        AMap.plugin('AMap.ToolBar', function () {//异步加载插件
            var toolbar = new AMap.ToolBar();
            map.addControl(toolbar);
        });

        AMap.plugin('AMap.Scale', function () {//异步加载插件
            var scale = new AMap.Scale();
            map.addControl(scale);
        });

        AMap.plugin('AMap.HawkEye', function () {//异步加载插件
            var HawkEye = new AMap.HawkEye();
            map.addControl(HawkEye);
        });


    </script>
</body>

</html>